# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=flatpak-builder
pkgver=1.0.11
pkgrel=0
pkgdesc="Tool to build flatpaks from source"
options="!check" # Testsuite fails on tests that require FUSE
url="https://flatpak.org"
arch="all"
license="LGPL-2.1-or-later"
depends="flatpak git elfutils"
makedepends="flatpak-dev glib-dev libsoup-dev json-glib-dev
	elfutils-dev libdwarf-dev libcap-dev curl-dev
	yaml-dev libxslt docbook-xsl docbook-xml xmlto"
subpackages="$pkgname-doc"
source="https://github.com/flatpak/flatpak-builder/releases/download/$pkgver/flatpak-builder-$pkgver.tar.xz
	modules-load.conf
	musl-fixes.patch
	hard-disable-rofiles-fuse.patch"
install="$pkgname.post-install"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/bin \
		--libexecdir=/usr/lib/$pkgname \
		--disable-static \
		--with-dwarf-header=/usr/include/libdwarf
	make
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/lib/modules-load.d
	install -m644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/flatpak-builder.conf
}

sha512sums="27c15ecccee79c6a7545f11d7c8cd7b80d4e99dc9c48818dd722934dfbe61e02b258b3db59946badfe5e1e189b39b509a2dbff1404a31a42c29ed4993fb5ec26  flatpak-builder-1.0.11.tar.xz
57d23d2778556eafc3035e6be575bf95b4032f123b35f2b1657eff5e7496de253173edc657f90531ee58e25673f4f27a5cd1cc76b14a038edb244f104a231771  modules-load.conf
07fe44dfaa2e55db1844930e75aca157fc94e89b1c6225422fa8b50f8d2281dc84dbce09b357649b48d807a4874e5cd80310fdabc0096ad72b158ff4e5c932b3  musl-fixes.patch
6b61c8ae3afbe0eb14cb14fb885b4e32ca48f9ca2471fef49a20922fe7580db9b3c7e9aca9511f4a281b6a09d01837a78a42be9da036831d27cd98ad1b0b8731  hard-disable-rofiles-fuse.patch"
